package org.cloud.config;

import io.swagger.v3.oas.models.OpenAPI;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.info.Info;

/**
 * ClassName: Swagger3Config
 * Package: org.cloud.config
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2024/4/10 - 21:44
 * @Version: v1.0
 */
@Configuration
public class Swagger3Config
{
    @Bean
    public GroupedOpenApi PayApi()
    {
        return GroupedOpenApi.builder().group("支付微服务模块").pathsToMatch("/pay/**").build();
    }
    @Bean
    public GroupedOpenApi OtherApi()
    {
        return GroupedOpenApi.builder().group("其它微服务模块").pathsToMatch("/other/**", "/others").build();
    }

    @Bean
    public OpenAPI docsOpenApi()
    {
        return new OpenAPI()
                .info(new Info().title("cloud2024")
                        .description("cloud2024")
                        .version("v1.0.0"))
                .externalDocs(new ExternalDocumentation()
                        .description("www.sixkey-world.top")
                        .url("https://www.sixkey-world.top"));
    }
}
